import pytest

import page
from page.page_in import PageIn
from tools.get_driver import GetDriver
from tools.get_log import GetLog
from tools.read_yaml import read_yaml
from time import sleep
log = GetLog.get_logger()


class TestAxaHomePage:

    def setup_class(self):
        driver = GetDriver.get_web_driver(page.axa_sit_homepage_url)
        self.homepage = PageIn(driver).page_get_PageAxaHomePage()

    def teardown_class(self):
        sleep(1)
        GetDriver.quit_web_driver()

    @pytest.mark.parametrize('title, cname, axa_personnelName, axa_licenceNo, expect', read_yaml('axa_homepage.yaml'))
    def test_axa_homepage(self, title, cname,  axa_personnelName, axa_licenceNo, expect):
        self.homepage.page_axa_homepage(title, cname, axa_personnelName, axa_licenceNo)

